﻿@namespace MudBlazor.Docs.Examples

<div class="d-flex">
    <MudButton OnClick="OpenDialog" Variant="Variant.Filled" Color="Color.Primary">
        Edit rating
    </MudButton>
    <MudRating SelectedValue="rating" Disabled="true" Class="mt-1 ml-3" />
</div>

<MudDialog @bind-IsVisible="visible" Options="dialogOptions">
    <TitleContent>
        <MudText Typo="Typo.h6">
            <MudIcon Icon="@Icons.Material.Filled.Edit" Class="mr-3" /> Edit rating
        </MudText>
    </TitleContent>
    <DialogContent>
        <p>How awesome are inline dialogs?</p>
        <MudRating @bind-SelectedValue="rating" Class="mt-3" />
    </DialogContent>
    <DialogActions>
        <MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="Submit" Class="px-10">Close</MudButton>
    </DialogActions>
</MudDialog>

@code {
    private bool visible;
    private int rating;
    private void OpenDialog() => visible = true;
    void Submit() => visible = false;

    private DialogOptions dialogOptions = new() { FullWidth = true };
}